#pragma once
#include <QVariant>
#include <QGraphicsItem>

#include <QRect>

class LayoutObject;
#include <QObject>

class ObjectVisual : public QObject, public QGraphicsItem
{
	Q_OBJECT
public:
	ObjectVisual(LayoutObject* obj);
	~ObjectVisual();
public:
	LayoutObject* LayoutObj() { return layoutObj_;  }
	void handleMouseDrag(QPointF start,QPointF end);

signals:
	void SelectionChanged(ObjectVisual* caller);
protected:
	QRectF boundingRect() const;
	void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
	//void QMouseMoveEvent (QMouseEvent * Event);
	QVariant itemChange(GraphicsItemChange change, const QVariant &value);
private:
	LayoutObject* layoutObj_;
	QPen RectPen_;
	//double unusedRotation_;
};